{#include file="top.php"#}
<script type="text/javascript">
    function gopage(rid){
        if(rid){
            window.location.href="/expert/report-detail-{#$pid#}-"+rid+".html";
        }
    }

    function callback(content){
        switch(content['retcode']){
            case 1:
                $("#loginText").text("以iMORE帳戶登入");
                $("#login").attr("onClick","login(func)");
                showLB('#dialog',0);
                break;
            default:
                break;
        }
    }


    function plikes(sec,sid){
        $.getJSON("/product.php?action=ajax&t=3",{sec:sec,sid:sid},function(data){
            if(parseInt(data.recode)==1){
                $('#'+sec+'_likes_'+sid).html(data.likes);
            }else if(parseInt(data.recode)==2){
                $("#loginText").text("以iMORE帳戶登入");
                $("#login").attr("onClick","login('plikes(\\'"+sec+"\\',"+sid+")')");
                $("#login_type").attr("onClick","fnblogin('plikes(\\'"+sec+"\\',"+sid+")')");
                showLB('#dialog',0);
            }else{
                showpop(data.msg);
            }
        });
    }



    /* function fb_recommend(sec,sid){
        $.getJSON("/product.php?action=ajax&t=12",{sec:sec,sid:sid},function(data){
            if(parseInt(data.recode)==1){
                $('#fb_recommend').html(data.likes);
            }else if(parseInt(data.recode)==2){
                $("#loginText").text("以iMORE帳戶登入");
                $("#login").attr("onClick","login('fb_recommend(\\'"+sec+"\\',"+sid+")')");
                $("#login_type").attr("onClick","fnblogin('fb_recommend(\\'"+sec+"\\',"+sid+")')");
                showLB('#dialog',0);
            }else{
                showpop(data.msg);
            }
        });
    } */


    function login(func){

        var email = $('#email').val();
        if($.trim(email).length==0){
            $('#email_tip').show();
            $('#email').focus();
            return false;
        }
        var password = $('#password').val();
        if($.trim(password).length==0){
            $('#password_tip').show();
            $('#password').focus();
            return false;
        }
        /*
                var captcha = $('#captcha').val();
                if($.trim(captcha).length==0){
                        alert("{#$ERR_CAPTCHA#}");
                        $('#captcha').focus();
                        return false;
                }
         */

        $.getJSON("/member.php?action=ajax_login_imore",{email:email,password:password/*,captcha:captcha*/},function(data){
            if(parseInt(data.ret)==1){
                showpop(data.msg);
            }else if(parseInt(data.ret)==2){
                showpop(data.msg);
            }else{closeLB();memberBar();eval(func);}
        });
    }

    function login_fnb(func){
        var email = $('#email').val();
        if($.trim(email).length==0){
            $('#email_tip').show();
            $('#email').focus();
            return false;
        }
        var password = $('#password').val();
        if($.trim(password).length==0){
            $('#password_tip').show();
            $('#password').focus();
            return false;
        }
        /*
                var captcha = $('#captcha').val();
                if($.trim(captcha).length==0){
                        alert("{#$ERR_CAPTCHA#}");
                        $('#captcha').focus();
                        return false;
                }
         */


        $.getJSON("/member.php?action=ajax_login_fnb",{email:email,password:password/*,captcha:captcha*/},function(data){
            if(parseInt(data.ret)==1){
                showpop(data.msg);
            }else if(parseInt(data.ret)==2){
                showpop(data.msg);
            }else{closeLB();memberBar();eval(func);}
        });
    }

    function fnblogin(func){
        $("#loginText").text("F&amp;B 會員登入 REGISTRATION");
        $("#login").attr("onClick","login_fnb("+func+")");
        $("#login_type_text").text("以 iMORE 登入");
        $("#login_type").attr("onClick","itriallogin("+func+")");
        $("#loginTextName").css("background-position","0 -940px");
        $("#classlogo").attr("class","itrial ir");
    }
    function itriallogin(func){
        $("#loginText").text("iTRIAL 會員登入 REGISTRATION");
        $("#login").attr("onClick","login("+func+")");
        $("#login_type_text").text("以 F&B 登入");
        $("#login_type").attr("onClick","fnblogin("+func+")");
        $("#loginTextName").css("background-position","0 -900px");
        $("#classlogo").attr("class","fabtn ir");
    }
    function showLB(ct,n){
        var sh=$(document).height();
        var sw=$(document).width();
        var st=$(window).scrollTop();
        var ch=$(window).height();
        var cw=$(window).width();
        var tbT=(Number(ch)/3+Number(st))+"px";
        var tbL=(Number(cw)/2)+"px";
        if(n==0){
            $("#fullbg").css({width:sw,height:sh});
            $(ct).css({top:tbT,left:tbL});
            $("#fullbg").fadeTo('slow', 0.4);
            $(ct).fadeIn('slow');
            $(window).scroll(function(){showLB(ct,1)});
            $(window).resize(function(){showLB(ct,1)});
        }else{
            if($("#fullbg").css("display")=="block"){
                $("#fullbg").css({width:sw,height:sh});
                $(ct).css({top:tbT,left:tbL});
            }
        }
    }

    function closeLB(){
        $("#fullbg").fadeOut('slow');
        $('#dialog').fadeOut('slow');
        $("#dialog_popup").fadeOut('slow');
    }

    function user_like(uid){
        $.getJSON("/person.php?action=ajax&t=1",{uid:uid},function(data){
            if(parseInt(data.recode)==2){
                var l = parseInt($('#user_likes').html());
                $('#like_bt').html("<a href='javascript:void(0);' class='btn_black' onclick='user_unlike("+uid+")'>取消關注</a>");
            }else if(parseInt(data.recode)==1){
                $("#loginText").text("以iMORE帳戶登入");
                $("#login").attr("onClick","login('user_like("+uid+")')");
                $("#login_type").attr("onClick","fnblogin('user_like("+uid+")')");
                showLB('#dialog',0);
            }else{
                showpop(data.msg);
            }
        });
    }

    function user_unlike(uid){
        $.getJSON("/person.php?action=ajax&t=2",{uid:uid},function(data){
            if(parseInt(data.recode)==2){
                var l = parseInt($('#user_likes').html());
                $('#like_bt').html("<a href='javascript:void(0);' class='btn_pink' onclick='user_like("+uid+")'>關注</a>");
            }else if(parseInt(data.recode)==1){
                $("#loginText").text("以iMORE帳戶登入");
                $("#login").attr("onClick","login('user_unlike("+uid+")')");
                $("#login_type").attr("onClick","fnblogin('user_unlike("+uid+")')");
                showLB('#dialog',0);
            }else{
                showpop(data.msg);
            }
        });
    }

    $(function() {
        $('.img_lightbox').lightBox();
    });
</script>


<div class="body">
    <div class="main">
        <div class="crumb">
            <a href="{#optimize_url('product', 'invite_list', 'mtype=5')#}">{#if $mtype eq 5#}尊業體驗團{#else#}試用專區{#/if#}</a> &gt;
            <a href="{#optimize_url('product', 'readReport_list', 'mtype=5')#}">{#if $mtype eq 5#}體驗團報告{#else#}試用報告{#/if#}</a> &gt;
            <strong>{#$product.type_name#} - {#$product.name#}</strong>
        </div>
        <div class="b_box b_box_t_rep {#if $mtype eq 5#}b_box_t_rep_exp{#/if#}">
            <div class="hd">
                <h2 class="hd_title">{#if $mtype eq 5#}體驗團報告{#else#}試用專區{#/if#}</h2>
            </div>
            <div class="bd">
                <figure class="imgbox">
					<div class="imgbox"><p class="img_p"><a class="img_lightbox" title="{#$product.cname#}" href="/{#$product.cover#}"><span><img src="{#$product._photo_url#}"></span></a></p></div>
                    <div class="product_scroce">
                        <i class="scorce">{#$product._overall#}</i>
                        <span>分</span>
                    </div>
                </figure>
                <h2 class="title_en">{#$product.type_name#} </h2>
                <h3 class="title_cn" style='margin-bottom:0px;'>{#$product.name#}</h3>
                <h3 class="title_cn">{#$product.cname#}</h3>
                <table>
                    {#foreach from=$product['_attr'] item=v key=k#}
                    <tr>
                        <th>{#$k#}</th>
                        <td class="td_m">：</td>
                        <td>{#$v#}</td>
                    </tr>
                    {#/foreach#}
                </table>

                <a href="javascript:void(0);"   onclick="plikes('product',{#$pid#})" class="btn_like">
                    <span id='product_likes_{#$pid#}'>{#$product.likes#}</span> like
                    <em class="i">+1</em>
                </a>
            </div>
            {#if $product.apply_starttime>('2000-01-01') && $product.report_endtime#}
            <div class="ft">
                <span class="exp_span">{#if $mtype eq 5#}體驗{#else#}試用{#/if#}期間 ：{#date('Y-m-d',strtotime($product.report_starttime))#} ~ {#date('Y-m-d',strtotime($product.report_endtime))#}</span>
                <span class="exp_span">{#if $mtype eq 5#}體驗{#else#}試用{#/if#}日數 ：{#$product._diff_day#}日</span>
                <span>名額 ：{#$product['quota']#}個</span>
                {#if (!empty($product['capacity_trial']))#}<div><span class="exp_span">{#if $mtype eq 5#}體驗{#else#}試用{#/if#}規格 ：{#$product['capacity_trial']#}</span></div>{#/if#}
            </div>
            {#/if#}
        </div>
        <div class="b_box b_box_pro_rep {#if $mtype neq 5#}b_box_pro_rep_ss{#/if#}">
            <div class="hd">
                <h2 class="hd_title">{#if $mtype eq 5#}體驗{#else#}試用{#/if#}評鑑報告</h2>
            </div>
            <div class="bd">
                <div class="box_hd">
                    <figure class="img_box">
                        <a href="{#optimize_url('person', 'report', 'username='|cat:$reports_list_res.username)#}" ><img src="{#$reports_list_res.photo_l#}" width=77 /></a>
                    </figure>
                    <h3 class="title"><a href="{#optimize_url('person', 'report', 'username='|cat:$reports_list_res.username)#}" >{#$reports_list_res.username#}</a></h3>
                    <p>年齡：{#$reports_list_res.agegroup_cname#}</p>
                    <p>臉部膚質：{#$reports_list_res.body_skin#}</p>
                    <span id="like_bt">
                        {#if $reports_list_res.islike==0#}
                        <a href="javascript:void(0);" class="btn_pink" onclick='user_like({#$reports_list_res.mid#})'>關注</a>
                        {#else#}
                        <a href="javascript:void(0);" class="btn_black" onclick='user_unlike({#$reports_list_res.mid#})'>取消關注</a>
                        {#/if#}
                    </span>
                    <em class="icon icon_master {#if $reports_list_res.user_type neq 5#}icon_master_g{#/if#}">{#if $reports_list_res.user_type neq 5#}試用專員{#else#}體驗達人{#/if#}</em>
                </div>
                <div class="box_mid">
                    <p>總評：{#if $reports_list_res.well==1#}很好{#else if $reports_list_res.well==2#}好{#else if $reports_list_res.well==3#}一般{#else if $reports_list_res.well==4#}差{#else if $reports_list_res.well==5#}很差{#/if#}</p>
                    <div class="star_box">
                        <table>
                            <tr>
                                {#foreach  from=$reports_list_res._category_score item=v1 key=k1#}
                                <th>{#$v1.v#}</th>
                                <td><strong class="star star_{#$v1.k#}">{#$v1.k#}星</strong></td>
                                {#if (($k1+1)%3) eq 0#}</tr><tr>{#/if#}
                                {#/foreach#}
                            </tr>
                        </table>
                        <br/>
                        <p class="que"><b>{#$reports_list_res.title#}</b></p>
                    </div>
                </div>
                <div class="box_bot">
                    <p>{#$reports_list_res.body#}</p>
                    {#foreach from=$reports_list_res._content item=v1 key=k1#}
                    {#if $v1.p#}
                        <a class="img_lightbox" title="{#htmlencode($v1.t)#}" href="/{#$v1.p#}">
                        <img src="/{#$v1.p#}" alt="pic" style='max-width:450px;' class="i" />
                        </a>
                        <p>{#htmlencode($v1.t)#}</p>
                    {#/if#}
                    {#/foreach#}
                </div>
            </div>
        </div>
    </div>
    <!-- main-->
    <div class="sidebar">
        {#show_block('b2',1,'','sidebar_ad')#}
        {#show_block('b1',2,'','sidebar_function')#}
        {#show_block('b3',0,'','sidebar_search')#}
        {#show_block('b13',0,'','sidebar_registation')#}
        {#show_block('b15',0,'','sidebar_new_invite sidebar_new b_box')#}
        {#show_block('b6',0,'','sidebar_facebook')#}
    </div>
    <!-- sidebar -->

</div><!--body-->

<iframe id="iframe1" name="iframe1" style="display:none"></iframe>

<!--  遮罩層  -->
<div id="fullbg"></div>
<div  class="irpopbox popbox b_box" id="dialog" style="z-index: 60;	display:none;">
    <div class="hd">
        <h2 class="ir ht" id=loginTextName><span id=loginText>iTRIAL 會員登入 REGISTRATION</span></h2>
        <a class="popclose" style="cursor:pointer" onclick="closeLB();">close</a>
    </div>
    <div class="bd">
        <div class="lbox">
            <p>會員名稱 USERNAME</p>
            <input type="text" class="ipt" name="email" id="email">
            <p class="tip" id="email_tip" style="display:none;">
                <em class="hack"></em>
                <a class="close" href="javascript:void(0);" onclick="$('#email_tip').hide();">close</a>
                {#php#}echo NO_USERNAME;{#/php#}
            </p>
            <p>密碼 PASSWORD</p>
            <input type="password" class="ipt" name="password" id="password">
            <p class="tip" id="password_tip" style="display:none;">
                <em class="hack"></em>
                <a class="close" href="javascript:void(0);" onclick="$('#password_tip').hide();"> close </a>
                {#php#}echo NO_PASSWORD;{#/php#}
            </p>
            <a class="btn_s btn_s_login" onclick="login()" style="cursor:pointer" id="login"><strong>login</strong></a>
            <ul>
                <li><a href="/member.php?action=forgetPassword">忘記密碼</a></li>
                <li><a href="/member.php?action=reg&toURL={#$thisUrl#}">註冊新帳號</a></li>
            </ul>
        </div>
        <div class="rbox">
            <div class="lgbox"><em class="hack"></em>
                <a class="fbtn ir" href="/member.php?action=login_facebook&toURL={#$thisUrl#}"><strong>以facebook登入</strong></a><span><a class="fb_link" href="/member.php?action=login_facebook&toURL={#$thisUrl#}">以facebook登入</a></span>
            </div>
            <div class="lgbox lgbox2" onClick="fnblogin()" id=login_type style="cursor:pointer" ><em class="hack"></em>
                <a class="fabtn ir" id=classlogo><strong>以F&amp;B登入</strong></a><span id=login_type_text  >以F&amp;B登入</span>
            </div>
        </div>
    </div>
</div>
<div style="top:400px;z-index:60;display:none;" class="apopbox popbox b_box" id="dialog_popup">
    <div class="hd">
        <h2 class="ir ht"><span>提示信息 ALERT</span></h2>
        <a class="popclose" onclick="closeLB();" style="cursor:pointer">close</a>            </div>
    <div class="bd">
        <p id="popupText"></p>
        <a class="btn_b btn_s_im_back" href="javascript:void(0);" onclick="closeLB();"><strong>立即返回</strong></a>            </div>
</div>
<script>
    function showpop(text){
        $("#fullbg").fadeIn();
        $("#dialog").fadeOut('slow');
        $("#dialog_limits").fadeOut('slow');
        showLB('#dialog_popup',0);
        $("#popupText").text(text);
    }

    $(document).ready(function(){

        $('#email').mousedown(check_register_email);
        $('#email').keyup(check_register_email);

        $('#password').mousedown(check_register_password);
        $('#password').keyup(check_register_password);

    });
    function check_register_email(){
        var rt = 0;
        if($('#email').val().length==0){
            $("#email_tip").addClass("tip").show();
        }else {
            $("#email_tip").removeClass("tip").hide();
            rt =  1;
        }
        return rt;
    }
    function check_register_password(){
        var rt = 0;
        if($('#email').val().length==0){
            $("#email_tip").addClass("tip").show();
        }else {
            $("#email_tip").removeClass("tip").hide();
            rt =  1;
        }
        return rt;
    }

    function check_cssby(tipmainname){

        var obj =$("#"+tipmainname+"_tip");
        if(obj.attr('class')!='tip'){
            return 1;
        }else{
            return 0;
        }
    }
    function check_register(){
        if($('#email').val().length==0){
            $('#email').focus();
            //alert("{#$NO_USERNAME#}");
            $('#email_tip').show();
            return false;
        }else if($('#password').val().length==0){
            $('#password').focus();
            //alert("{#$NO_PASSWORD#}");
            $('#password_tip').show();
            return false;
        }else{
            $("#form1").submit();
        }
    }
    $(document).ready(function(){
        $('#email').focus();
    });
</script>
{#include file="footer.php"#}